package com.example.retrofitinterface;

import com.example.bean.DataBean;
import com.example.bean.Result;
import com.example.bean.TestData;
import com.example.okhttp.RHandler3;
import com.okhttp.annotations.ApiGenerateService;
import com.okhttp.annotations.ApiResponseHandler;
import com.okhttp.cache.CacheControl;
import com.okhttp.retrofit.BaseResponseHandler;
import com.okhttp.retrofit.mock.Mock;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * @author GYL
 * @dateTime 2020/4/24-14:50
 * @description
 */
@ApiGenerateService(RHandler3.class)
public interface Net2 {
  
  /**
   * /test
   * @param test
   * @return
   */
  //@Headers(CacheControl.CACHE_HEADER)
  @FormUrlEncoded
  @POST("test")
  public Call<Result<TestData>> doGet1(@Field("postTest") String test);
  
  //@Headers(CacheControl.CACHE_HEADER)
  @FormUrlEncoded
  @POST("city")
  public Call<Result<DataBean>> doGet2(@Field("postTest") String test);
//
  @ApiResponseHandler(
    handler = Callback.class
  )
  @Headers(CacheControl.CACHE_HEADER)
  @FormUrlEncoded
  @POST("city")
  public Call<DataBean> doGet3(@Field("postTest") String test);


  @Mock("http://www.baidu.com")
  @GET("/")
  Call<String> doGet5();



}



